#include <iostream>
#include <string>

using namespace std;

int prefixFunctionSearching(const string& text, const string& pattern){
    int patternLen = pattern.length();
 
    int* prefixFunction = new int[patternLen];
	//function for prefix zero length is equal to zero
    prefixFunction[0] = 0;

    //calculation of the prefix function
    //for the empty prefix and the prefix of a single element function is zero
    int k = 0;
    for (int i = 1; i < patternLen; ++i){
       while (k > 0 && pattern[i] != pattern[k]) 
           k = prefixFunction[k - 1];
         
       if (pattern[i] == pattern[k]) 
		   k++;
       prefixFunction[i] = k;
    }
    //serching
    k = 0;
    for (int i = 0; i < text.length(); ++i){
        while (k > 0 && pattern[k] != text[i]) 
            k = prefixFunction[k - 1];
         
        if (pattern[k] == text[i]) k++;
        if (k == patternLen) {
            delete[] prefixFunction;
            return i - patternLen + 1;
        }
    }
    
    delete[] prefixFunction;
    return -1;
}


int main() {
    string text, pattern;
    text = "";
    char ch;
	ch = getchar();

	//reading text
    while (ch != '\n' && ch != EOF) {
        text = text + ch;
        ch = getchar();
	}

    pattern = "";
	ch = getchar();

	//reading pattern
    while (ch != '\n' && ch != EOF) {
        pattern = pattern + ch;
	    ch = getchar();
	}

	//while pattern is not empty, handle requests
    while (pattern != "") {
        if (text.length() < pattern.length()) cout << "Too long pattern" << endl;
        else {
            int answer = prefixFunctionSearching(text, pattern);
            if (answer != -1) 
				cout << answer << endl;
            else cout<<"There is no such pattern in your text"<<endl;
        }

        pattern = "";
        ch = getchar();
        
		//reading new pattern
        while (ch != '\n' && ch != EOF) {
            pattern = pattern + ch;
            ch = getchar();
        }

    }

    return 0;
}

